home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / games / lorri4.zip / INITGAME.SCR < prev    next >
Text File  |  1995-09-24  |  5KB  |  152 lines

  1. !
  2. ! FILE : initgame.scr
  3. !
  4. ! DESCRIPTION
  5. !   Example introduction script.  This script is executed when the game
  6. !   is first started.  A party of a single player has been created with
  7. !   initial values set to those found in statistics record # 0, with
  8. !   the following additions:
  9. !
  10. !     group.gold        = 1000;   (1000 silver or 100 gold)
  11. !     group.food        =   25;
  12. !     player.name       = "John Doe";
  13. !     player.type       = 0; ! 'REGULAR' in the standard DCCTOKEN.DAT file
  14. !     player.class      = 0; ! 'HUMAN'   in the standard DCCTOKEN.DAT file
  15. !     player.level      = 1;
  16. !     player.experience = 1;
  17. !     player.energy     = 1000;
  18. !
  19. ! You may change any group and/or player attributes in this script, and
  20. ! may call the 'edit_player()' function to invoke the character creation
  21. ! screen.  This function accepts a the following parameters:
  22. !
  23. !   edit_player( which,                 (1 to 6, required)
  24. !                points to distribute   (0 to 40, default 25), 
  25. !                min attribute value    (0 to 255, default 9),
  26. !                max attribute value    (0 to 255, default 20),
  27. !                allow-name-edit        (1 = yes, 0 = no, default 1),
  28. !                allow-class-edit       (1 = yes, 0 = no, default 1),
  29. !                allow-block-edit       (1 = yes, 0 = no, default 1),
  30. !                allow-attribute-0-edit (1 = yes, 0 = no, default 1),
  31. !                allow-attribute-1-edit (1 = yes, 0 = no, default 1),
  32. !                ... );
  33. ! Only the first parameter is required, all others may be omitted.
  34. !
  35. ! Note that the automatic adjustments for 'class' are now part of this
  36. ! script, instead of part of the 'edit_player' function.  They occur
  37. ! AFTER character creation.  A small price to pay for the flexibility
  38. ! provided by 'edit_player'.
  39. !
  40. ! If you don't wan't to use the character creation screen, you may set
  41. ! the attributes in many different ways, for example:
  42. !
  43. ! You might get the name this way:
  44. !   :XLOOP
  45. !     write( "What is your name: " );
  46. !     L0 = getstr( "Hey You" );
  47. !     if S0 = "" goto XLOOP;  ! You HAVE to enter a name
  48. !     player.name = S0;
  49. !
  50. ! You might set the class using a menu, as follows:
  51. !   L0 = select( "Wizard", "Elf", "Dwarf" );
  52. !   on L0 goto XWIZ, XELF, XDWARF;
  53. !   :XWIZ   player.class = WIZARD; goto XNEXT;
  54. !   :XELF   player.class = ELF;    goto XNEXT;
  55. !   :XDWARF player.class = DWARF;  goto XNEXT;
  56. !   :XNEXT
  57. !
  58. ! Or directly...
  59. !   player.class = ELF;
  60. !
  61. ! The standard attributes can be set directly in statistics record # 0
  62. ! (using the DCWORLD program) or in this script by direct assignment.
  63. !
  64. ! The usual values in the standard statistics record # 0 for the attribute
  65. ! fields is a 9.
  66. !
  67.  
  68. !------------------------------------------------------------------------!
  69.  
  70. ! Record how much memory is left after starting the game driver just
  71. ! in case I run into memory problems later and want to know this info.
  72.  
  73. system( "mem /C >freemem.xxx" );
  74. if failure then
  75.   writeln( "Couldn't run FREEMEM.XXX. Press <space>" );
  76.   pause;
  77. endif;
  78.  
  79. ! Do the initial sequence of music, graphics, etc
  80. !
  81. music   ( "intro1.cmf" );  ! Play background music
  82. viewpcx ( "intro1.pcx" );  ! Show a nice picture
  83. wait    ( 120 );
  84. music   ( "intro2.cmf" );  ! Play background music
  85. readtext( "intro1.txt" );  ! Read some text.
  86. paint   ( screen );        ! Needed to restore the screen and the palette !
  87.  
  88. !
  89. ! Now, create the player's character by using 'edit_player'
  90. !
  91.   edit_player( 1 );
  92.   on player.class goto XHUMAN,XELF,XDWARF,XWIZARD,XARCHER,XFIGHTER;
  93.  
  94.   ! any other, drop into 'XHUMAN'
  95.  
  96. :XHUMAN
  97.   goto DONE; ! No adjustments for 'Humans'
  98.  
  99. :XELF
  100.   inc( player.mspd );
  101.   dec( player.mstr );
  102.   inc( player.mpwr );
  103.   goto DONE;
  104.  
  105. :XDWARF
  106.   inc( player.mstr );
  107.   inc( player.mdex );
  108.   dec( player.mspd, 2 );
  109.   inc( player.mhp,  2 );
  110.   goto DONE;
  111.  
  112. :XWIZARD
  113.   inc( player.miq,  2 );
  114.   inc( player.mpwr, 3 );
  115.   dec( player.mstr, 3 );
  116.   dec( player.mhp,  2 );
  117.   goto DONE;
  118.  
  119. :XARCHER
  120.   inc( player.maim, 2 );
  121.   inc( player.mspd, 2 );
  122.   dec( player.mstr, 2 );
  123.   goto DONE;
  124.  
  125. :XFIGHTER
  126.   inc( player.mstr, 4 );
  127.   inc( player.mhp,  2 );
  128.   inc( player.miq,  4 );
  129.   goto DONE;
  130.  
  131. :DONE
  132.  
  133. ! Here, you may transfer the party to any location at which you wish
  134. ! the game to start. For example, to start in world 3, 2 squares 
  135. ! south (down) and 5 right from the location of door 7, use:
  136. !
  137. !   teleport( 3, world.doorx(7) + 5, world.doory(7) - 2 );
  138. !
  139. ! You may also set the group's X and Y location directly if you wish
  140. ! to alter the location within world zero.
  141. !
  142. ! The default start location is right over the location of door 0 in
  143. ! world 0.
  144. !
  145.  
  146.   dec( group.y ); ! Start example game 1 square above door 0 in world 0
  147.   music( stop );
  148.   STOP;  ! Use CONTINUE if you want the driver to invoke edit_player()
  149.  
  150.                                                                           
  151.